package com.atguigu.gmall.feign.list;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.list.Goods;
import com.atguigu.gmall.model.list.SearchParam;
import com.atguigu.gmall.model.vo.GoodsSearchResultVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("service-list")
@RequestMapping("/rpc/inner/list")
public interface ListFeignClient {
    //elasticsearch查询接口,内部微服务调用
    @PostMapping("/save")
    Result saveGoods(@RequestBody Goods goods);


    @DeleteMapping("/delete/{skuId}")
    Result deleteGoods(@PathVariable("skuId") Long skuId);

    @PostMapping("/search/result")
    Result<GoodsSearchResultVo> searchResult(@RequestBody SearchParam searchParam);

    @PutMapping("/updateScore/{skuId}/{score}")
    Result updateScore(@PathVariable("skuId") Long skuId, @PathVariable("score") Long score);
}
